# ! /usr/bin/env python
# coding=utf-8
'''
@author: guichaochao

@desc: UI控件定义

'''
import os
import time
import unittest
from appium import webdriver
from time import sleep
import HTMLTestRunner
from knowbox1.testBase import appiumBase
from knowbox1.public.method import CommonMethod
from selenium.webdriver.common.by import By
class exercise(appiumBase):
    #登录button：id
    lgbt_loc = "com.knowbox.rc.student.pk:id/login_btn"
    # 号码密码输入框：classname
    input_loc = "android.widget.EditText"
    # 登录提交button：id
    lgsub_loc = "com.knowbox.rc.student.pk:id/login_submit_btn"
    # 登录错误弹框：id
    lgerror_loc = "com.knowbox.rc.student.pk:id/dialog_common_confirm"
    # 闯关icon：id
    blockade_loc = "com.knowbox.rc.student.pk:id/main_tab_blockade"
    # 同步练数学入口控件:xpath
    enter_loc = "//android.view.View[@resource-id=\"com.knowbox.rc.student.pk:id/gl_blockade_grid\"]/android.widget.FrameLayout[4]/android.widget.ImageView[1]"
    # 开始学习按钮:id
    start_loc = "com.knowbox.rc.student.pk:id/start_study"
    # 小象按钮:id
    elephant_loc = "com.knowbox.rc.student.pk:id/iv_blockade_content_row_icon"
    # 更换教辅:id
    changebook_loc = "com.knowbox.rc.student.pk:id/rl_exercise_select_book"
    # 更换年级:id
    changegrade_loc = "com.knowbox.rc.student.pk:id/rl_exercise_select_book"
    # 选择年级:xpath
    selectgrade_loc = "//android.widget.ListView[@resource-id=\"com.knowbox.rc.student.pk:id/lv\"]/android.widget.LinearLayout[1]/android.widget.RelativeLayout[1]"
    # 选择当前页面最后一本教辅:xpath
    selectbook_loc = "//android.widget.ListView[@resource-id=\"com.knowbox.rc.student.pk:id/lv_exercise_book_list\"]/android.widget.LinearLayout[6]/android.widget.RelativeLayout[1]"
    # 教材栏显示(沪教版（试用本）一年级上册):uiautomator
    book_loc = "new UiSelector().text(\"沪教版（试用本）一年级上册\)"
    # 教材第一单元：id
    unit1_loc = "com.knowbox.rc.student.pk:id/ll_unit_book"
    # 知识点：xpath
    level_loc = "//android.widget.RelativeLayout/android.widget.RelativeLayout[5]/android.widget.ImageView[1]"
    # 开始答题：id
    startanswer_loc = "com.knowbox.rc.student.pk:id/btn_single"
    # 单元练习查看答案按钮：id
    viewanswer_loc = "com.knowbox.rc.student.pk:id/tv_view_answer"
    # 单元练习查看答案后返回：id
    answerback_loc = "com.knowbox.rc.student.pk:id/bottom_btn_layout"
    # 单元练习切换下一题：id
    nextanswer = "com.knowbox.rc.student.pk:id /tv_play_next"
    # 结果页关闭按钮：id
    closeres_loc = "com.knowbox.rc.student.pk:id/iv_exercise_result_close"
    # 地图页主title：id
    maptitle_loc = "com.knowbox.rc.student.pk:id/tv_exercise_map_title"
    # 试用期有温习旧题拿金币的特殊弹框：id
    vippay_loc = "com.knowbox.rc.student.pk:id/iv_exercise_map_vip_pay"
    # 特殊弹窗关闭按钮：id
    vipclose_loc = "com.knowbox.rc.student.pk:id/close_btn"
    # 订正错题的icon：id
    correct_loc = "com.knowbox.rc.student.pk:id/btn_single"
    # 未解锁的关卡：xpath
    locklevel_loc = "//android.widget.RelativeLayout/android.widget.RelativeLayout[3]"
    # 未解锁title：id
    lock_loc = "com.knowbox.rc.student.pk:id/title"
    # 第一个关卡：android_uiautomator
    firstlevel_loc = "new UiSelector().text(\"1\")"
    # pk赛icon：id
    pk_loc = "com.knowbox.rc.student.pk:id/pk_icon"
    # 开通或续费按钮：id
    renew_loc = "com.knowbox.rc.student.pk:id/to_renew"
    # 7天购买栏：id
    sevenbuy_loc = "com.knowbox.rc.student.pk:id/tv_week"
    # 30天购买栏：id
    thirtybuy_loc = "com.knowbox.rc.student.pk:id/tv_month"
    # 首页用户状态栏：id
    userinfo_loc = "com.knowbox.rc.student.pk:id/user_vip_info"
    # 首页返回按钮：id
    fpback_loc = "com.knowbox.rc.student.pk:id/back"
    # 首页返回确认按钮：id
    confirm_loc = "com.knowbox.rc.student.pk:id/btn_cancel"
    # 体力值icon：id
    power_loc = "com.knowbox.rc.student.pk:id/power"
    # 首页返回取消按钮：id
    cancel_loc = "com.knowbox.rc.student.pk:id/btn_ok"
    # 立即支付按钮：id
    impay_loc = "com.knowbox.rc.student.pk:id/price_bg_img"
    # 支付宝支付按钮：id
    alipay_loc = "com.knowbox.rc.student.pk:id/ll_payment_alipay"
    # 支付确认按钮：id
    payconfirm_loc = "com.knowbox.rc.student.pk:id/btn_payment_confirm"
    # 确认付款按钮：xpath
    confirmpay_loc = "//android.widget.FrameLayout/android.widget.FrameLayout[3]/android.widget.FrameLayout[2]"
    # 支付宝密码输入框1：id
    password1_loc = "com.alipay.android.app:id/spwd_rl_1"
    # 支付宝密码输入框2：id
    password2_loc = "com.alipay.android.app:id/spwd_rl_2"
    # 支付宝密码输入框3：id
    password3_loc = "com.alipay.android.app:id/spwd_rl_3"
    # 支付宝密码输入框4：id
    password4_loc = "com.alipay.android.app:id/spwd_rl_4"
    # 支付宝密码输入框5：id
    password5_loc = "com.alipay.android.app:id/spwd_rl_5"
    # 支付宝密码输入框6：id
    password6_loc = "com.alipay.android.app:id/spwd_rl_6"
    # 支付宝页面完成按钮：android_uiautomator
    alifinish_loc = "new UiSelector.text(\"完成\")"
    # 付款完成按钮：id
    payfinish_loc = "com.knowbox.rc.student.pk:id/btn_payment_finish"
    # 支付结果页支持成功文案：android_uiautomator
    paysucess_loc = "new UiSelector.text(\"支付成功\")"
    # 微信支付按钮：id
    wxpay_loc = "com.knowbox.rc.student.pk:id/ll_payment_wx"
    # 微信立即支付按钮：id
    wxpay_loc = "com.tencent.mm:id/db8"
    # 微信密码输入框：id
    wxinput_loc = "com.tencent.mm:id/c5l"
    # 微信支付完成按钮：id
    wxfinish_loc = "com.tencent.mm:id/da4"
    # pk赛更换教材教辅：id
    pkchangebook_loc = "com.knowbox.rc.student.pk:id/grade_layout"
    # pk赛更换年级：id
    pkchangegrade_loc = "com.knowbox.rc.student.pk:id/rl_exercise_select_grade"
    # pk赛选择年级：xpath
    pkselectgrade_loc = "//android.widget.ListView[@resource-id=\"com.knowbox.rc.student.pk:id/lv\"]/android.widget.LinearLayout[2]/android.widget.RelativeLayout[1]"
    # pk赛选择当前页面最后一本教辅:xpath
    pkselectbook_loc = "//android.widget.ListView[@resource-id=\"com.knowbox.rc.student.pk:id/lv_exercise_book_list\"]/android.widget.LinearLayout[6]/android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]"
    # pk赛年级栏：id
    pkgrade_loc = "com.knowbox.rc.student.pk:id/grade"
    # pk赛按钮：id
    pkbutton_loc = "com.knowbox.rc.student.pk:id/pk_view"
    # 匹配对手按钮：id
    matchplay_loc = "com.knowbox.rc.student.pk:id/match_btn"
    # pk答题页面返回按钮：id
    pkback_loc = "com.knowbox.rc.student.pk:id/btn_cancel"
    # 排行榜icon：id
    rank_loc = "com.knowbox.rc.student.pk:id/rank_view"
    # 排行榜页底部去pk按钮：id
    rankgopk_loc = "com.knowbox.rc.student.pk:id/tv_exercise_rank_bottom_btn"
    # pk赛页面title：id
    pktitle_loc = "com.knowbox.rc.student.pk:id/title"
    # pk排行榜省榜tab：id
    province_loc = "com.knowbox.rc.student.pk:id/tv_exercise_rank_all_province_region"
    # pk排行榜全国榜tab：id
    country_loc = "com.knowbox.rc.student.pk:id/tv_exercise_rank_all_country_region"
    # 排行榜第一名位置：android_uiautomator
    no1_loc = "new UiSelector().text(\"1\")"
    # 奖励规则icon：id
    rule_loc = "com.knowbox.rc.student.pk:id/tv_exercise_rank_menu"
    # 奖励规则省榜tab：id
    rulepro_loc = "com.knowbox.rc.student.pk:id/tv_exercise_rank_rule_province"
    # 奖励规则全国榜tab：id
    rulecoun_loc = "com.knowbox.rc.student.pk:id/tv_exercise_rank_rule_country"
    # 奖励规则弹窗关闭按钮：id
    ruleclose_loc = "com.knowbox.rc.student.pk:id/close_btn"
    # 排行榜页面分数：id
    score_loc = "com.knowbox.rc.student.pk:id/tv_pk_score"
    # 排行榜页面返回按钮：id
    rankback_loc = "com.knowbox.rc.student.pk:id/back"
    # pk点图标：id
    pkicon_loc = "com.knowbox.rc.student.pk:id/coin_count"
    # 任务按钮：id
    task_loc = "com.knowbox.rc.student.pk:id/task_view"
    # 去做任务按钮：id
    dotask_loc = "com.knowbox.rc.student.pk:id/tv_do_task"
    # pk排行榜title：id
    ranktitle_loc = "com.knowbox.rc.student.pk:id/tv_exercise_rank_title"
    # 基础练习title：id
    unittitle_loc = "com.knowbox.rc.student.pk:id/tv_exercise_unit_title"





















